#pragma once

#include "QEnvPrereqs.h"
#include "QCmdLine.h"

#ifndef QENV__STATUS__HH__
#define QENV__STATUS__HH__

class QStatusBar;
class QPlainTextEdit;
class QMainWindow;

namespace QTools
{
	class Log
	{
		String mName;
	public:
		Log( const String &name );
		Log( );
		Log( const Log& log );

		void setName( const String &name );
		const String &getName() const;
	
		String logMessage( const String &msg, bool maskVerbose=false, bool maskDebug = true );
	};
};

class QEnvStatus
{
	static QStatusBar * mStatus;
	static QPlainTextEdit * mLogEdit;
	static QWidget * mInstance;

	static QTools::Log			mLog;
public:
	QEnvStatus(void);
	~QEnvStatus(void);

	static void addStatus( const String &status, int timeout=0, bool maskVerbose = false, bool log = true );
	static void addMessage( const String &status, bool maskVerbose=false, bool maskDebug = false );

	static QWidget * appInstance();
	static QPlainTextEdit * logEdit();
	static QStatusBar * statusBar();

	static void _register( QWidget *instance, QStatusBar * b, QPlainTextEdit * edt );
};
#endif